#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wxversion
#wxversion.select('2.9.5-Phoenix')
wxversion.select('2.9.4-msw')
import wx
import sys
import os
from core import Core
#import wx.lib.agw.advancedsplash as AS

sys.path.append('./')
sys.path.append(os.path.abspath(os.curdir))
#from core import Core

class Druid(wx.App):
    def __init__(self):
        wx.App.__init__(self, False)


    def OnInit(self):
        bitmap = wx.Image('data/media/druid_splash.jpg', wx.BITMAP_TYPE_JPEG).ConvertToBitmap()
        wx.SplashScreen(bitmap,wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_TIMEOUT, 1000,None,style=wx.BORDER_NONE | wx.STAY_ON_TOP)
        #AS.AdvancedSplash(None, bitmap=bitmap, timeout=5000,agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT | AS.AS_SHADOW_BITMAP, shadowcolour=shadow)
        
        
        self.core=Core()
        self.core.launch()
        self.SetTopWindow(self.core.getMainFrame())
        return True


def run():
    #try:
        druid = Druid()
        druid.MainLoop()
    #except:
    #    pass

if __name__ == '__main__':
    run()